﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Pixysoft.Framework.Configurations
{
    public interface IConfiguration
    {
        /// <summary>
        /// 获取指定的id
        /// </summary>
        string Id { get;}

        /// <summary>
        /// 名称
        /// </summary>
        string Name { get;}

        /// <summary>
        /// 保存到默认文件
        /// </summary>
        void Save();

        /// <summary>
        /// 配置文件导出
        /// </summary>
        /// <param name="filepath"></param>
        void Save(string filename);

        /// <summary>
        /// 配置文件导出为可序列化对象
        /// </summary>
        /// <param name="filepath"></param>
        void SaveAsObject(string filename);


        /// <summary>
        /// 配置文件序列化
        /// </summary>
        /// <returns></returns>
        string Serialize();

        /// <summary>
        /// 是否indent
        /// </summary>
        /// <param name="indent"></param>
        /// <returns></returns>
        string Serialize(bool indent);

        /// <summary>
        /// 配置文件序列化
        /// </summary>
        /// <returns></returns>
        string SerializeAsObject();


        /// <summary>
        /// 取得节点 节点虽然集成了配置文件接口 但是不一定全部支持
        /// </summary>
        /// <param name="nodeName"></param>
        /// <returns></returns>
        IConfigurationNodeCollection Node { get;}

        /// <summary>
        /// 取得集合节点
        /// </summary>
        /// <param name="nodeName"></param>
        /// <returns></returns>
        IConfigurationNodesCollection Nodes { get;}
    }
}
